<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>顾客请假申请</title>
	 <%include("/common/include.html"){}%>
	 <link rel="stylesheet" type="text/css" href="${cxt!}/sb/css/bootstrap.css">
	 <style type="text/css">
	 .panel-body{
	 padding:0;
	 }
	 </style>
</head>
<body>
	<div class="easyui-layout" style="width:100%;height:100%;">
		<form id="leave" method="post">
			<div data-options="region:'north'" style="padding:0px;height:60px;">
				<div style="height:50px">
					<%include("/customer/searchCustomer4.html"){}%>
				</div>
			</div>
			<div data-options="region:'center'"  style="overflow-x:hidden;">				
				<%include("/leaveApplication/leaveItem.html"){}%> 
			</div>
		</form>
	</div>
	<script>
	
	//清空顾客信息
	function clearsj(){
		window.location.reload();
	}
	
	//获取顾客信息
	function searchCus()
	{	
		var reData=getCusInfo();
		if(reData.msg==200)
		{
			initTargetSumTable();
		}
		
	}
	</script>
	<script>
		//保存请假顾客
		function save(){
			if($("#customerName").val() != "" && $("#customerPhone").val() != "" && $("#customerHybh").val() != ""){
				if($("#cusName").val() != "" && $("#date").val() != "" && $("#cause").val() != "" && $("#class").val() != ""){
					if($("#startDate").val()<=$("#endDate").val()){
						$.ajax({
			                cache: true,
			                type: "POST",
			                url:"${cxt !}/leaveApplication/saveLeave",
			                data:$('#leave').serialize(),// 你的formid
			                dataType:'json',
			                async: false,
			                success: function(result) {		                	
			                	if(result.msg == "200")
			                	{	
			                		$.slideMsg("保存成功", parent.$);
			                		location.reload();
			                	}else{		                		
			        					 $.alert(parent.$,result.msg);
			                	}
			                }
			            });
					}else{
						$.alert(parent.$,"开始时间不能小于结束时间，请正确填写");
					}
				}else{ 
					$.alert(parent.$,"请假信息填写不完整，请完善信息");
					
				} 
			}else{
				$.alert(parent.$,"请先搜索顾客信息");
			}
		}
	</script>
</body>
</html>